package com.yx.front.controller;


import com.yx.front.config.global.CommonResult;
import com.yx.front.manager.SystemNoticeManager;
import com.yx.front.model.param.SystemNoticeParam;
import com.yx.front.model.vo.SystemNoticeVo;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 系统通知表 前端控制器
 * </p>
 *
 * @author YangXiong
 * @since 2023-04-23
 */
@Slf4j
@RestController
@RequestMapping("/system-notice")
public class SystemNoticeController {
    @Resource
    private SystemNoticeManager systemNoticeManager;

    @PostMapping("/save")
    @ApiOperation("保存用户对系统的建议")
    public CommonResult<String> save(@RequestBody SystemNoticeParam param){
        return systemNoticeManager.save(param);
    }

    @GetMapping("/history")
    @ApiOperation("获取当前用户的历史反馈")
    public CommonResult<List<SystemNoticeVo>> getHistory(){
        return systemNoticeManager.getHistory();
    }
}

